<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
       let arr1=[1,2,3,4,5,6];
       let arr2=[3,5,4,7,8,9];
       let a=new Set(arr1);
       let b=new Set(arr2);
       let arr3=new Set(arr1.filter(x=>!b.has(x)));
       let arr4=new Set(arr2.filter(x=>!a.has(x)));
       var diff=[...arr3,...arr4];
       console.log(diff);//[1,2,6,7,8,9]
    </script>
</body>
</html>